<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- .enter 修饰符 -->
        <!-- 当你按下键盘键，并且这个键是 enter键的时候，才出发 -->
        <input  @keyup.enter="handleKeyUp" type="text" placeholder="按下enter保存" >
        <!-- <input  @keyup.13="handleKeyUp" type="text" placeholder="按下enter保存" > -->
        <!-- <input  @keydown.13="handleKeyUp" type="text" placeholder="按下enter保存" > -->
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{},
            methods: {
                handleKeyUp:function(e){
                    console.log("按下了：",e.code);
                }
            },
        })
    </script>
</body>
</html>